package edu.chalmers.Framework_EXAMPLES;

import edu.chalmers.AV_2DPlatformerFramework.Model.*;
import edu.chalmers.AV_2DPlatformerFramework.Model.Hitbox.HitboxMalformedException;
import edu.chalmers.AV_2DPlatformerFramework.Utility.Vector2D;
import edu.chalmers.AV_2DPlatformerFramework.View.Camera;
import MyGame.Object_Edmund;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;

/**
 *
 * @author Joakim
 */
public class BallExampleModel extends GameModel {
    
    public Camera camera;
    
    public BallExampleModel(Camera c) throws HitboxMalformedException{
        super();
        System.out.println("BallExampleModel");
        GameObject gobj1 = new EXAMPLE_Object_TheDude();
        GameObject gobj2 = new EXAMPLE_Bench(new Vector2D(0.1, 0));
        GameObject gobj3 = new EXAMPLE_AnimatedDude();
        GameObject gobj4 = new EXAMPLE_AnimatedDude();
        
        gobj1.setVelocity(new Vector2D(1, 0));
        gobj2.setVelocity(new Vector2D(2, -0.2));
        gobj3.setVelocity(new Vector2D(0, 0));
        gobj3.setVelocity(new Vector2D(-1, -0.5));
        
        gobj1.setPosition(new Vector2D(100, 100));
        gobj2.setPosition(new Vector2D(200, 0));
        gobj3.setPosition(new Vector2D(500, 0));
        gobj4.setPosition(new Vector2D(700, 0));
        
        for (int i = 0; i < 15 ; i++){
            gobj4.getVisual();
        }
        
                
        GameObject[] uniqueObjects = {
                                        gobj1,
                                        gobj2,
                                        gobj3,
                                        gobj4
                                     };

        
        this.maps = new ArrayList<>();       
        GameWorld gw = new GameWorld    (new int[][] {
                                            {0, 500,    500,    550,    550,    600,    600,     650,     650,     700,     1300,   },
                                            {0,   0,    -30,    -30,    -60,    -60,    -90,     -90,     -120,    -120,    -120,   }
                                        },
                                            new Vector2D(0, 150),
                                            ".\\src\\main\\java\\Textures\\dirtTile.jpg"
                                         );
        this.maps.add(new GameMap(uniqueObjects, gw));
        this.maps.get(0).setMainActor(gobj1);
    }

    @Override
    public synchronized void run() {
        moveActiveObjects();
    }
    
    
}
